﻿@page "/Admin"
@using Moments.Model
@inject IFreeSql Db

<MRow Class="mb-6"
      NoGutters>
    <MCol Cols="12" Xl="4" Md="4" Sm="6" Class="pa-2">
        <MCard Tile Elevation="0">
            <MListItem ThreeLine>
                <MListItemAvatar Tile Size=80 Color="grey">
                    <MIcon Color="white" Size="64">mdi:mdi-account-arrow-up</MIcon>
                </MListItemAvatar>
                <MListItemContent>
                    <div class="text-overline mb-4">
                        朋友
                    </div>
                    <MListItemTitle Class="text-h5 mb-1">
                        @_friend 个
                    </MListItemTitle>
                </MListItemContent>
            </MListItem>
        </MCard>
    </MCol>
    <MCol Cols="12" Xl="4" Md="4" Sm="6" Class="pa-2">
        <MCard Tile Elevation="0">
            <MCard Tile Elevation="0">
                <MListItem ThreeLine>
                    <MListItemAvatar Tile Size=80 Color="grey">
                        <MIcon Color="white" Size="64">mdi:mdi-rss</MIcon>
                    </MListItemAvatar>
                    <MListItemContent>
                        <div class="text-overline mb-4">
                            订阅
                        </div>
                        <MListItemTitle Class="text-h5 mb-1">
                            @_article 条
                        </MListItemTitle>
                    </MListItemContent>
                </MListItem>
            </MCard>
        </MCard>
    </MCol>
    <MCol Cols="12" Xl="4" Md="4" Sm="6" Class="pa-2">
        <MCard Tile Elevation="0">
            <MCard Tile Elevation="0">
                <MListItem ThreeLine>
                    <MListItemAvatar Tile Size=80 Color="grey">
                        <MIcon Color="white" Size="64">mdi:mdi-account-arrow-up</MIcon>
                    </MListItemAvatar>
                    <MListItemContent>
                        <div class="text-overline mb-4">
                            Api
                        </div>
                        <MListItemTitle Class="text-h5 mb-1">
                            N 次
                        </MListItemTitle>
                    </MListItemContent>
                </MListItem>
            </MCard>
        </MCard>
    </MCol>
</MRow>


@code {
    long _friend;
    long _article;

    protected override async Task OnInitializedAsync()
    {
        _friend = await Db.Select<Friend>().CountAsync();
        _article = await Db.Select<Article>().CountAsync();
    }

}